﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using ElectronicCommerce.Framework.Logging;

namespace ElectronicCommerce.Framework.Data.Entity
{
    internal static class EntityBuilderLogger
    {

        private const string logCategory = "ElectronicCommerce.Framework.Data.Entity.EntityBuilder";

        [Conditional("TRACE")]
        public static void LogAddTypeInfo(Type type)
        {
        }

        [Conditional("TRACE")]
        public static void LogGetPropertyBindingInfoException(Type type, string columnName, Exception e)
        {

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("columnName:\t" + columnName);
            sb.AppendLine("Message:\t" + e.Message);
            sb.AppendLine("StackTrace:\t" + e.StackTrace);
            sb.AppendLine("Source:\t" + e.Source);

            Logger.Log(logCategory, LogLevel.Error, sb.ToString());
        }
    }
}
